<template>
    <div class="position">
      <span class="iconfont position__icon">&#xe605;</span>
      应急管理大学北区八号楼
      <span class="iconfont position__notice">&#xe7e5;</span>
    </div>
    <div class="search">
      <b class="iconfont">&#xe600;</b>
      <input class="search__text" placeholder="国哥小商场会员优惠商品"/>
    </div>
    <div class="banner">
      <img
        class="banner__img"
        src="http://www.dell-lee.com/imgs/vue3/banner.jpg"
      />
    </div>
    <div class="icons">
      <div class="icons__item" v-for="icon in iconsList" :key="icon.id">
        <img
          :src="`http://www.dell-lee.com/imgs/vue3/${icon.imgName}.png`"
          class="icons__item__img"
        />
        <p class="icons__item__desc" v-text="icon.desc" />
      </div>
    </div>
    <div class="gap"></div>
</template>

<script>
export default {
  name: 'StaticPart',
  setup () {
    const iconsList = [
      { id: 1, imgName: '超市', desc: '超市便利' },
      { id: 2, imgName: '菜市场', desc: '菜市场' },
      { id: 3, imgName: '水果店', desc: '水果店' },
      { id: 4, imgName: '鲜花', desc: '鲜花绿植' },
      { id: 5, imgName: '医药健康', desc: '医药健康' },
      { id: 6, imgName: '家居', desc: '家居时尚' },
      { id: 7, imgName: '蛋糕', desc: '烘培蛋糕' },
      { id: 8, imgName: '签到', desc: '签到' },
      { id: 9, imgName: '大牌免运', desc: '大牌免运' },
      { id: 10, imgName: '红包', desc: '红包套餐' }
    ]
    return { iconsList }
  }
}
</script>

<style lang="scss" scoped>
@import "../../style/variables.scss";
@import "../../style/mixins.scss";
.position {
  position: relative;
  padding: 0.16rem 0.24rem 0.16rem 0;
  line-height: 0.22rem;
  font-size: 0.16rem;
  color: $content-fontcolor;
  @include ellipsis;
  .position__icon {
    position: relative;
    top: 0.02rem;
    font-size: 0.22rem;
  }
  .position__notice {
    position: absolute;
    right: 0;
    top: 0.17rem;
    font-size: 0.22rem;
  }
}
.search {
  display: flex;
  margin-bottom: 0.12rem;
  height: 0.32rem;
  line-height: 0.32rem;
  background: $search-bgColor;
  color: $search-fontColor;
  border-radius: .16rem;
  .iconfont {
    display: inline-block;
    padding: 0 0.12rem 0 0.16rem;
    font-size: 0.16rem;
  }
  &__text {
    display: inline-block;
    width: 100%;
    font-size: 0.14rem;
    color: #b7b7b7;
    outline: none;
    border: none;
    background-color: $content-bgColor;
  }
}
.banner {
  height: 0;
  overflow: hidden;
  // 超出不展示--把banner 固定在这 避免了抖动
  padding-bottom: 25.4%;
  &__img {
    width: 100%;
  }
}
.icons {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.16rem;
  &__item {
    width: 20%;
    &__img {
      display: block;
      margin: 0 auto;
      width: 0.4rem;
      height: 0.4rem;
    }
    &__desc {
      margin: 0.06rem 0 0.16rem 0;
      text-align: center;
      color: $content-fontcolor;
    }
  }
}
.gap {
  margin: 0 -0.18rem;
  height: 0.1rem;
  background: $content-bgColor;
}
</style>
